import os
import platform
import sys
import requests


# 17类型转化
def change_type(input_file, post_conversion_type):
    """

    :param input_file: 输入文件地址
    :param post_conversion_type: 0: "float", 1: "int", 2: "string"
    :return: 数组格式输出数据
    """

    post_conversion_type = int(post_conversion_type)
    with open(input_file) as file_obj:
        array = eval(file_obj.read())
        after = []
        if post_conversion_type == 0:
            for value in array:
                after.append(float(value))
        if post_conversion_type == 1:
            for value in array:
                after.append(int(value))
        if post_conversion_type == 2:
            after = array

        return after


if __name__ == '__main__':
    print(change_type(sys.argv[1], sys.argv[2]))
    # print(change_type("../test_data/test.txt", 0))
